﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GFrame.Data;
using GFrame.Shadow.Search;

using System.Data;
using EZCRS.HCMS.Entity;

namespace EZCRS.HCMS.SqlClient.AIR
{
    public class AirLog
    {
        private ShadowSearch<AIR_Log> _search;

        public AirLog()
        {
            _search = new ShadowSearch<AIR_Log>();

            _search.ConnectionName = MainBase.CONNECTION_STRING;
        }

        public List<AIR_Log> SearchLog(int PID, DateTime StartDate, DateTime EndDate)
        {
            ParamList pl = new ParamList();

            pl.Add("@pid", SqlDbType.Int, PID);
            pl.Add("@start", SqlDbType.DateTime, StartDate);
            pl.Add("@end", SqlDbType.DateTime, EndDate);

            return _search.Search("PID = @pid AND StartDate = @start AND EndDate = @end", pl);

        }
    }
}
